import {
  AUDIT_STATE_OPTIONS,
  LATENT_PRODUCT_TYPES_OPTIONS,
  PRODUCT_TYPES_ENUMS
} from '@/constants/commodity';
export const FORM_ITEMS = [
  {
    prop: 'recordNo',
    label: '单据编号：',
    type: 'input',
    searchType: 'EQ'
  },
  {
    prop: 'commitType',
    label: '商品大类',
    type: 'select',
    options: LATENT_PRODUCT_TYPES_OPTIONS,
    defaultVal: PRODUCT_TYPES_ENUMS.NORMAL,
    searchType: 'EQ'
  },
  {
    prop: 'operName',
    label: '提交人名称：',
    type: 'input'
  },
  {
    prop: 'auditorName',
    label: '审核人名称：',
    type: 'input'
  },
  {
    prop: 'auditState',
    label: '审核状态：',
    type: 'select',
    clearable: true,
    options: AUDIT_STATE_OPTIONS
  },
]
export const TABLE_COLUMNS = [
  {
    title: '单据编号',
    key: 'recordNo',
    width: 200,
  },
  {
    title: '提交人',
    key: 'operName',
    width: 90,
  },
  {
    title: '提交人部门',
    key: 'operDeptName',
    width: 90,
  },
  {
    title: '停/启状态',
    width: 90,
    render: (h, { row }) => {
      if (row.enableStatus === '1') {
        return <span class="success_color">{ row.enableStatusStr }</span>
      }
      if (row.enableStatus === '2') {
        return <span class="error_color">{ row.enableStatusStr }</span>
      }
    }
  },
  {
    title: '提交时间',
    key: 'opeTime',
  },
  {
    title: '审核状态',
    key: 'auditStateStr',
  },
  {
    title: '审核人',
    key: 'auditorName',
  },
  {
    title: '审核人部门',
    key: 'auditorDeptName',
  },
  {
    title: '审核时间',
    key: 'auditTime',
  }
];
